import request from '@/utils/request'

// 监测类型
export function typeSoil() {
  return request({
    // url: '/system/dict/data/type/tr_type',
    url: '/system/dict/data/type/product_monitor_type',
    method: 'get',
  })
}
// 监测级别
export function levelSoil() {
  return request({
    url: '/system/dict/data/type/dept_level',
    method: 'get',
  })
}
// 查询食用林土壤检验判定标准列表
export const getSoilStandardList = (params) => {
  return request({
    url: '/forest/syl/soil/standard/groupList',
    method: 'get',
    params
  })
}

// 查看土壤监测标准详情
export const getSoilStandardDetailList = (params) => {
  return request({
    url: '/forest/syl/soil/standard/list',
    method: 'get',
    params
  })
}

// 文件上传
export const uploadFile = (data) => {
  return request({
    url: '/file/upload',
    method: 'post',
    data
  })
}
// 生成土壤监测标准表
export const generateStandardTable = (data) => {
  return request({
    url: '/forest/syl/soil/standard/generateStandardTable',
    method: 'post',
    data
  })
}

// 新增土壤监测标准
export const addSoilStandard = (data) => {
  return request({
    url: '/forest/syl/soil/standard',
    method: 'post',
    data
  })
}

// 获取土壤监测标准详细信息
export const getSoilStandardDetail = (id) => {
  return request({
    url: `/forest/syl/soil/standard/${id}`,
    method: 'get'
  })
}

// 修改土壤监测标准
export const updateSoilStandard = (data) => {
  return request({
    url: '/forest/syl/soil/standard',
    method: 'put',
    data
  })
}

// 删除土壤监测标准
export const deleteSoilStandard = (id) => {
  return request({
    url: `/forest/syl/soil/standard/${id}`,
    // url: `/forest/syl/soil/standard/deleteBatch/${id}`,
    method: 'delete'
  })
}
